extends ../layout

append css
    link(rel='stylesheet',href='/components/jquery-upload-file/css/uploadfile.css')

block content
    h2.page-header= routeRecommend._id?'修改路线信息':'保存路线信息'

    form.vertical-form
        div.form-group.hide
            label(for="title") ID
            input.form-control(name="_id", id="_id", value=routeRecommend.id)

        div.form-group
            label(for="title") 线路名称：
            input.form-control(name="title", id="title", required="true", placeholder="请输入景点名称...", value=routeRecommend.title)

        div.form-group
            label(for="content") 内容：
            textarea.form-control(name="content", id="content", required="true")= routeRecommend.content

        div.form-group
            label(for="favorite") 点赞人数：
            input.form-control(name="favorite", id="favorite", required="true", type="number", value=routeRecommend.favorite)

        div.form-group
            label(for="published") 是否发布：
            input(name="published", id="published", type="checkbox", checked=routeRecommend.published)

        div.form-group.image-part
            label(for="image") 图片：
            #image
            #img-preview
                if !!routeRecommend.images
                    each image in routeRecommend.images
                        .image-item(data-id=image.id)
                            img(src='../../../uploads/image/'+image.filename)
                            .image-info
                                span= image.originalname
                                a(href='javascript:;',data-destination=image.destination,data-filename=image.filename,data-id=image.id,class='remove-image',title='移除')
                                    span.fa.fa-times-circle 移除

        div.form-group
            a.btn.btn-info(type="submit",id='submit-btn',href="javascript:;")= routeRecommend._id?'修改路线信息':'保存路线信息'

block scripts
    script(src="/js/ckeditor/ckeditor.js")
    script(src="/components/jquery-upload-file/js/jquery.form.js")
    script(src="/components/jquery-upload-file/js/jquery.uploadfile.js")
    script(src="/js/lib/ajaxUtil.js")
    script(src='/js/lib/route-urlData.js')
    script(src="/js/admin/routeRecommend.js")
